{#if props}
  <ListItem
    {component}
    {props}
    {key}
    {index}
    {length}
    on:initialized
  />
{/if}
<script>
  import ListItem from './ListItem.html'
  import { mark, stop } from '../../_utils/marks.js'

  export default {
    async oncreate () {
      const { makeProps, key } = this.get()
      if (makeProps) {
        const props = await makeProps(key)
        mark('ListLazyItem set props')
        this.set({ props })
        this.fire('initialized')
        stop('ListLazyItem set props')
      }
    },
    data: () => ({
      props: undefined
    }),
    components: {
      ListItem
    }
  }
</script>
